package org.esprit.ocm.client.rpc.oca;

import java.util.List;

import org.esprit.ocm.model.oca.ImageOca;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("ImageOcaService.rpc")
public interface ImageOcaService extends RemoteService {

	/**
	 * List All hosts
	 * 
	 * @param client
	 * @return
	 * @throws Exception
	 */
	public List<ImageOca> listAll(String secret, String endpoint, int filter) throws Exception;

	/**
	 * Create New Image
	 * 
	 * @param client
	 * @param template
	 * @param image
	 * @return
	 * @throws Exception
	 */
	public String allocate(String secret, String endpoint, String template) throws Exception;

	/**
	 * Delete an image
	 * 
	 * @param client
	 * @param imgId
	 * @return 
	 * @throws Exception
	 */
	public String delete(String secret, String endpoint, int imgId) throws Exception;

	/**
	 * Describe Image information
	 * 
	 * @param client
	 * @param imgId
	 * @return
	 * @throws Exception
	 */
	public ImageOca info(String secret, String endpoint, int imgId) throws Exception;

	/**
	 * Enable Image
	 * 
	 * @param client
	 * @param imgId
	 * @return
	 * @throws Exception
	 */
	public String enable(String secret, String endpoint, int imgId) throws Exception;

	/**
	 * disable image
	 * 
	 * @param client
	 * @param imgId
	 * @return
	 * @throws Exception
	 */
	public String disable(String secret, String endpoint, int imgId) throws Exception;

	/**
	 * publish image
	 * 
	 * @param client
	 * @param imgId
	 * @return
	 * @throws Exception
	 */
	public String publish(String secret, String endpoint, int imgId) throws Exception;

	/**
	 * unpublish image
	 * 
	 * @param client
	 * @param imgId
	 * @return
	 * @throws Exception
	 */
	public String unpublish(String secret, String endpoint, int imgId) throws Exception;

	/**
	 * Remove attribute from image template
	 * 
	 * @param client
	 * @param imgId
	 * @param att_name
	 * @return
	 * @throws Exception
	 */
	public String rmattr(String secret, String endpoint, int imgId, String att_name) throws Exception;

	/**
	 * Update attribute from image template
	 * 
	 * @param client
	 * @param imgId
	 * @param att_name
	 * @param att_val
	 * @return
	 * @throws Exception
	 */
	public String update(String secret, String endpoint, int imgId, String att_name, String att_val) throws Exception;
}
